<extend name='Public/_Main' />
<block name='right'>
    <!-- Nav tabs -->
    <ul class="nav nav-tabs" role="tablist">
        <volist name='list.config' id='vo'>
            <li role="presentation" <if condition="$key eq 0">class='active'</if>><a href="#{$vo.id}" aria-controls="{$vo.id}" role="tab" data-toggle="tab">{$vo.name}</a></li>
        </volist>
    </ul>
    <!-- Tab panes -->

    <div class="tab-content">
        <volist name='list.config' id='vo'>
            <div role="tabpanel" class="tab-pane  <if condition=" $key eq 0 ">active</if>" id="{$vo.id}">
            <div class='table-responsive'>
                <table class="table table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>标识</th>
                            <th>标题</th>
                            <th>更新时间</th>
                            <th>所属类别</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <volist name='vo.child' id='list'>
                        <tr>
                            <td>
                                {$list.id}
                            </td>
                            <td>
                                {$list.name}
                            </td>
                            <td>
                                {$list.title}
                            </td>
                            <td title='<{$list.create_time}>'>
                                {$list.update_time}
                            </td>
                            <td>
                                {$list.group.name} </td>
                            <td>
                                <div role="group" class="btn-group">
                                    <a href="{:U('saeConfig',array('id'=>$list['id']))}" class="btn btn-default">编辑</a>
                                    <a href="{:U('delete_Config',array('id'=>$list['id']))}" class="btn btn-danger getajax">删除</a></div>
                            </td>
                        </tr>
                    </volist>
                </table>
                </div>
            </div>
        </volist>
    </div>
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增配置项</h4>
                </div>
                <div class="modal-body">
                    <form class="require" action="{:U('addConfig')}" method="post">
                        <div class="form-group">
                            <label for="exampleInputEmail1">配置标识<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder="例：WEB_TITLE" datatype='*' nullmsg='配置标识不可为空' errormsg='格式错误' name="name" ajaxurl='__URL__/config_name'>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">配置标题<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder="例：网站标题" datatype='*' nullmsg='请填写配置标题' errormsg='格式错误' name="title" ajaxurl='__URL__/config_name'>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">配置分类<span class="Validform_checktip"></span></label>

                            <select name="group" class='form-control selectpicker' datatype='*' data-live-search="true">
                                <volist name='group' id='vo'>
                                    <option value="{$vo.id}">
                                        {$vo.name}
                                    </option>
                                </volist>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">排序<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder="例：1" datatype='n' nullmsg='' errormsg='必须是数字' name="sort" value='{$sort}'>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">配置值<span class="Validform_checktip"></span></label>
                            <textarea class="form-control" rows="3" placeholder="例：你好，亲" datatype='*' nullmsg='配置值不可为空' errormsg='格式错误' name='value'></textarea>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">说明<span class="Validform_checktip"></span></label>
                            <textarea class="form-control" rows="3" placeholder="例：用户网站前台标题配置" datatype='*' nullmsg='配置说明不可为空' errormsg='格式错误' name='remark'></textarea>
                        </div>
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-primary btn-block" type="submit">保存配置</button>
                        </div>
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-default btn-block" type="button"  data-dismiss="modal">关闭</button>
                        </div>
                    </form>
                    <br/>
                    <br/>
                    <br/>
                </div>
            </div>
        </div>
    </div>
    <!--end Modal-->
</block>
